package com.hyh.toyshopping.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @version 1.0
 * @BelongsProject:IntelliJ IDEA
 * @BelongsPackage:com.hyh.toyshopping.model
 * @Author:hyhWTX
 * @ClassName:User
 * @CreateTime:2022年-12月-14日 19:36
 * @Description: 用户实体类表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private Integer user_id;
    private  String user_name;
    private  String user_password;
    private String user_email;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date user_birthday;
    private String user_hobbys;
    private Integer user_sex;
    private  String user_address;
    private Integer user_status;


        public void setUser_hobbys(String[] user_hobbys){
        this.user_hobbys = "";
        for (String hobby : user_hobbys) {
            this.user_hobbys= this.user_hobbys+"_"+hobby;
        }
        this.user_hobbys = this.user_hobbys.substring(1);
    }
}
